Have you tried a different pin another LED?
I do not see anything wrong with the part of your code you have posted.
How do you have TRISB set?
If you post the whole code it would help.