I assume that both computers can connect to the internet, correct?
If so, first see if your machines can see each other. On one iMac, launch System Preferences->Network and select whatever connection type you are using in the left side of the window (i.e. Airport or Ethernet). On the right side of the window it should show your IP address (192.168.1.100 for example). Then go to your other machine and launch Terminal and type
ping <your other iMacs IP Address>
It should spew out a bunch of lines, one by one etc, saying something like '64 bytes from .... time = 12.565 ms" etc. If it says connection failed, then the problem is the machines can't see each other. If it succeeds, then go into System Preferences->Sharing and make sure that File Sharing is enabled. If it is, uncheck it and then check it again. If that doesn't work, go to System Preferences->Security->Firewall and check the "Allow all incoming connections" checkbox. If that doesn't work I have no clue... Good luck...