this is quite challenging. but given that you already have formatted the mbr, let alone install ubuntu... the boot code will be on the ubuntu installation at this point. with that, there is nothing left to do but reinstall everything from scratch; formatting all partitions, installing vista, then win7, then ubuntu. you have to take note though that linux operating systems create more than one partition: namely the root, data, and swap partitions (correct me if i'm wrong, but i'm sure there are 3 or 4 based from what i had in the past when i installed opensuse).
also, boot operations are handled quite differently between those 3 operating systems, given that vista boots by mbr/gpt, win7 boots with GPT, and linux... not exactly sure - but it is partition or LVM-based depending on how you set it up. for the most part, i too am having trouble dual booting linux and win7 for some reason...
but then again, that's just what i think. i may be wrong with what i mentioned above, so anyone please correct me if it is so. i'm still in the process of learning each operating systems i use. i just got started with linux a few weeks back, and for windows 7 - much to my frustration, made it my primary os without dual-booting...