When we connect two devices (say a PC and some embedded board, or two PCs) with a serial cable (RS232) we use a female female cross-cable. Apparently this is called a "null modem" connection - and if one doesn't have a cross-cable, one can use a special null modem adapter.
This wikipedia article provides a nice overview of the subject.
If you just want to hack on some serial port code on your computer without actually connecting anything, there are also virtual null modem drivers that emulate serial ports on the PC and can "connect them together". For instance, such a driver can be used to create two new ports, say COM13 and COM14 and "connect them". Then, to applications it seems that ports COM13 and COM14 really exist on the computer, and if one application sends something to COM13 then the application listening at COM14 will receive it, and vice versa.
A couple of free programs to allow this are:
N8VB vCOM and
com0com.