I read this comic a long time ago. In it, Iron Man traveled back to the past (a time where people used swords and armor). He gets imprisoned and beaten up. His girlfriend in the present is an archaeologist, or something like that. She digs and find the Iron Man suit's head with a skull on it. I haven't read the rest, yet.
I'm fairly sure you're describing "In Shining Iron", a 2002 three-part story in which:
Tony Stark invents a time-machine and travels back to the land of knights and chivalry.