It's pretty simple, even a girl could explain it. Wait, I am a girl!
Taking your harddrive out is what changed its letter, its nothing to do with using it on your friend's machine.
The assigning of drive letters to external storage devices is simple, it just assigns them any letter after the standard C for your hard drive, and D, E, F etc. for all your extra partitions, hard drives and disk drives. Then maybe G for a USB stick, and I for an external hard drive. In this example, if you remove the USB stick and restart your computer, the next time you start up, your hard drive will be a G.
If you need it to have a particular letter, do this: go on explorer, look at what now has an F by it. Say it is a USB stick. Switch off your computer. Remove The device that had the label as F, and attach your hard drive. Restart your computer. It should now be F, as desired. Now you can reattach the device that had stolen the F before, and it will become G.