Other USB ports (stick to the rear ports) and other USB keyboard/mice?
The symptom sounds like a heat or other failure. I'm sure you know about the yearly canned air cleaning but if not, look into that as well.
My desktop has been problem free until the mouse and keyboard stopped working intermittently. The optical mouse and keyboard (usb) loose power. I have to shut down the cpu and restart. It happens while I'm online (using Mozilla Firefox). Could I have a failing controller card or power supply? Everything else seems to be operating fine. The mouse/keyboard failures seem to happen within the first 10 minutes of opening the browser or after 45 mins - hour. They don't shut off while I'm offline in any other applications.