You would need to use a crossover Ethernet cable. Crossover cables have the transmit & receive lines crossed so that a signal from one machines's transmit line goes to the other machine's receive line.

Connect the two machines with a crossover cable, and it's the same process as with a hub or switch after that point.

To get file sharing set up, I'd recommend you check out the tutorial linked below from Practically Networked:
http://www.practicallynetworked.com/...ilesharing.htm