Barcelona: I agree with Cinc Sentits for modern Catalan food.
Tactica Berri for pinxtos; le Cerveseria Catalana for tapas; Guimet & Guimet for wine and simple tapas (standing only).
Madrid: Combarro for some of the best Gallician seafood; for tapas, the bars around Cava Baja offers some of the best: Casa Lucas, Taberna Almendro, also check out tapas places around Placa Santa Ana, Chamberi.
I earlier posted a few of my favorites on this site. Search under Spain for: Sauc or Alkimia; Eck! only 2 nights in Barcelon...where must we dine; Arce, La Broche or Viridiana.
Have a great time and please report back.