Connect your machines using cat 5 or 6 cable through a gigabit ethernet router that supplies IP addresses (DHCP is a good way to go).
go to the Digital Rebellion website and do a search for using Qmaster and Compressor. Good instructions there.
Once you have Qmaster set up on both machines, Compressor can send jobs.
To Run AE in render farm mode, you need to install the AE render engine on each network node (computer) and set up a watch folder. The help menu in AE explains it.
Just for the record, AE's watch folder system is highly unreliable. It was working fine for my simple tests, but when I started throwing actual production compositions at it, it started crashing on built in after effects plugins.
the aerender command line tool seems much more stable, but it does not offer any sort of automated distribution.