There is a TON of useful information on eating in Madrid at
www.chowhound.com.
To state only the most obvious. Yes, most bars serve acceptable-to-excellent tapas. If you are staying near the museums, Calle Huertas is a good place to start - but many of those bars are also music clubs, and this is their emphasis.
For nouvelles tapas head to Cava Baja, near the Plaza Mayor. You have many, many more but these are good:
Posada de la Villa for Jamón, Croquetas -- this is fancier than the average tapas bar and is actually a good restaurant, but if you go in the door and turn to the left, there is a bar area that will serve you tapas.
Conspiradores for Pimientos rellenos
Taberna Txakoli for a wide variety of excellent tapas
Taberna Tempranillo, a wine bar with a wide range of Spanish labels, specializing in cured meats (pork).
As for dinner -- if it is your first visit to Madrid you might like Botín. Yes it is touristy, but the food is actually quite good, and the atmosphere is unbeatable. It is the oldest restaurant in Madrid (see the last chapter of The Sun Also Rises) and opens at 8 pm (an advantage).
¡Que aproveche!