You can connect two computers directly by plugging a "crossover" network cable between their ethernet ports. Alternatively, you could connect both with "straight-wired" network cables to your ethernet hub, but there is no merit in using a hub unless you want to network three or more computers.
Having connected them, in order that they can communicate, each network adapter needs to have an IP address. How this is done depends on whether or not you are going to use "Internet Connection Sharing" or only run File & Printer sharing over the network.
Without "Internet Connection Sharing"
Go into the Network Connections folder, right click the Local Area Connection and select Properties. Highlight the entry for "Internet Protocol (TCP/IP)" and click the Properties button. In the Properties sheet that opens, select "Use the following IP address" and enter:
1st PC - IP address 192.168.0.1
2nd PC - IP address 192.168.0.2
Both - Subnet Mask 255.255.255.0
As there is no internet involvement, the Default Gateway and DNS Server addresses can be left blank.
With "Internet Connection Sharing"
To enable “Internet Connection Sharing” in Windows XP, open the Network Connections folder, right click the actual internet connection (modem connection), select Properties and then the Advanced tab. Tick the box “Allow other network users to connect through this computer’s Internet connection” .
When you enable "Internet Connection Sharing" on the Internet connection, it automatically configures the network adapter used for your "Home Network Connection" with the IP address 192.168.0.1 and subnet mask 255.255.255.0. If you have more than one adapter available for this purpose, e.g. both a "Local Area Connection" and a "Wireless Network Connection", you will have a drop down list from which to select the appropriate adapter. The "Client" PC's Local Area Connection should be set to get its IP address automatically, which it does by DHCP from the "Host" PC. Also, if you run the Zone Alarm firewall in your "Host" PC, the Internet Zone Security level must be reduced from High to Medium or "ICS" traffic will be blocked.
Any folders that you want to have available over the network need to be "shared" by right clicking and selecting the Sharing & Security option and at least one folder should be "shared" in each computer. Any firewall software should be configured to allow access to the networked computers, which may involve adding their IP addresses in a "trusted" section.