its not that compicated, even if it might sound a little like this :P
at first boot with a linux cd you got at hand, dunno some debian or suse or a readhat cd ... they all contain so called rescue systems.
when this rescue system has bootet just create lets say /mylinux
then mount your root partition into this dir, i dunno if you are familiar with all this, but dont take it as offence :P
mount /dev/hda2 /mylinux
where hda2 should of course be replaced with your root partition
if you got a separate usr, boot, or partitions like that just mount them to their coresponding dirs under /mylinux
after you mounted all your partitions type 'chroot /mylinux'
hmm you also might have to remount the /proc to /mylinux/proc before you use chroot ... but i forgot the command ;P
now you are in your linux, now you just have to type 'lilo' and the linux boot loader should be reinstalled to its previous state ... after all this just type reboot :P
and about the booting from the windows boot loader ... it requires a working lilo or grub but not on the master boot record but maybe on your boot, or root partition.
to get the bootsector you need, you will have to type
dd if=/dev/partitionwhereliloresides of=/linboot.bin bs=512 count=1
now you have to get this linboot.bin to your windows harddrive
and edit the boot ini to contain something like this
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional"
then it should work ...
well but you will have to create a new linboot.bin file every time you reinstall lilo, in case you change the kernel
Uhm that should be enough for now
if anything is wrong dont blame me, the syntax of the commands might have some small mistakes as i wrote all this just from my mind :P If you knew me you would be scared by now, hehe