Cannot connect USB device – error message with recognition

Hello,
I cannot connect my usb mouse with my pc. I try to connect it and each time it show an error message which says usb device not recognized and sometimes later I find it working perfectly. I do not understand what is happening. Kindly someone inform me if it is a software or hardware error and the possible solutions.
Daniel Murdoch
