Most likely you forgot to initialize the TRIS registers and the ports are in a high impedance mode. Put this into your code and post your code if it still does not work.
Code:
TRISA = %00000000 ' make all ports outputs
TRISB = %00000000 ' make all ports outputs
I did that myself last week