Could somebody explain to me briefly what the Rambam's opinion is about the sequence of events with Olam HaBa, the Mashiach and Techiyat haMeitim?

It seems that he's saying that when a person dies they go straight to Olam HaBa, the ultimate reward, but if so I don't understand how Techiyat haMeitim fits into this.

(I've been reading the Ramchal (Derech Hashem, Ma'amar haIkarim, and Da'at Tevunot), and he follows the Ramban's opinion, and I'm very happy to continue my progress reading the Ramchal, but I'm afraid I'm going to embarrass myself in conversation if I'm totally ignorant the Rambam's opinion.)