Hadrons and Quarks in Dense Matter: From Nuclear Matter to Neutron Stars