The area round Plaza Santa Ana is great. Good food, drink and atmosphere. Cafe Central for quality live jazz (you have to pay). On Sunday, the Rastro and Retiro park are nice for strolling away the hours.
http://www.frommers.com/destinations/madrid/N26328.html – i’ve seen this described as one of the best bars in the world. It’s certainly very nice. The streets round there are full of excellent bars, some old and traditional some modern (eg Lamucca de Prado)
Puerta del Sol is the central, most tourist bit but has some great places – Examples. Papa bravas for the Patatas Bravas. Malaspinas for the croquettes. Casa de Abuela for the prawns.
Different areas, different atmospheres, eg Malasana district, more quirky, arty…
If it’s a long weekend visit El Escorial
Superb city