You might start by checking out this link:
Programming Cable Pinout?
The 20-047 cable handles a lot of issues including employing an FTDI chip to emulate a COM port over a USB connection. I looked into making this cable myself a few years ago. If you want to do it for fun that's one thing, but it's probably going to be cheaper to buy the real thing.
If you do a search for the cable you'll find a lot of threads on it. I don't think there is a schematic here of the 20-047, but it's just the cable I've posted the schematic for above, coupled with the FTDI end (which you can get from FTDI along with the driver you'll need to use it).