I would say the best place to start is Air Europa. You say your initial flight EZE-MAD was delayed by at least 5 hours. What was the reason? Read a recent decision by the European Court of Justice that says 5-hour-plus delays are just like cancellations, and that mechanical problems don't constitute "extraordinary circumstances":
http://ec.europa.eu/dgs/legal_servic.../07c402_en.pdf. It might be easiest to leave out the BA/IB confusion and just get the money from Air Europa. If that doesn't work I would go to BA for Denied Boarding compensation since it was BA that wouldn't let you on their plane, even if ground staff was IB.