Moved to the 8300 section.
Do you have Desktop Manager installed on your PC? You need that to install the proper drivers.
Are you connecting via a HUB? If so connect directly into the PC.
Have you tried a wall charger or a car charger? Do either of those work?
An alternative to DM is the BB Swiss Army Knife - BBSAK. Use Google to find it and install.
For an OS, see the yellow sticky at the top of the 8300 section. Make sure that you have the correct OS as it is model specific, meaning for the 8310, you need the 8310 OS. The instructions for installation are there as well. Make sure that you follow them exactly and be patient. It can take an hour or longer.
I personally do not see it as a software or OS issue. MY opinion is that if it doesn't charge, then it could be either the battery or a bad USB port.