Depends on the system, it is usually a system driver, like USB or similar, when I've experienced this on a broke PC, I've had to manually repair the registry to a previous version to fix. I usually just reformat and reinstall, which is not the solution path I take often.
The last time I seen this, it was caused by improper shutdown, corrupting system files. Took me ages to figure out, until I had the client (same problem 2 weeks in a row) show me that he would physically unplug the PC after it froze :|