Defenitely you can connect two pcs through cable without the use of switch or hub.
As Sultan said, you can connect otwo pcs with one cross over cable. Now, there is no need of such cross over cables to make connection between two laptops (LAN). Straight cable is enough to make connection between two modern laptops.
The important factor to make a LAN connection between two computers are the IP address range.
I will tell you an example.
Take the following settings to make a LAN connection between two Pcs.
PC1- IP address: 192.168.1.1, Subnet Mask : 255.255.255.0
PC2- IP address: 192.168.1.2, Subnet Mask : 255.255.255.0
After made these settings and physical connection through above mentioned cable, Check the pinging between Pcs.
For that, open command prompt and type "Ping 192.168.1.2" from PC1. If you get reply from PC2, Connection may working properly.
Try it with PC2, "ping 192.168.1.1"