I do this all the time since I am already traveling with my laptop and do not want to bring another plug.
When I connect the BB to the laptop XP wants to install the device. I just hit Cancel and the BB starts charging.
key Point: Make sure that you have the computer set to NOT Sleep as once the computer starts to Sleep it will stop the power to the USB port and not continue to charge the BB
It does take significantly longer to charge from the computer than the outlet but I normally just plug the BB in at night and in the morning it is fully charged.