It doesnt sound like an OS problem to me. Could be power supply, could be something in the motherboard. Legacy mouse and keyboard stuff is sort of "off to the side" from motherboard developers perspectives these days. In other words, its not done particularly elegantly. I've seen stuff like this with linux variants that a reinstall solved, but those machines were highly hacked up by the owner and they had a lot more problems than keyboard/mouse failure to initialize.
You might have a bad keyboard or mouse, can you borrow someone elses to check that?
At the same time, try your keyboard and mouse on that someone elses known good computer.
Check the bios settings and if you know how to do it, and what you're doing, reflash the bios.
Go into 'system' under control panel, then device manager, then check the keyboard and mouse and see if there are any conflicts. If possible, try 'reinstall driver' on both. Make sure the driver names seem to match the hardware.
Have you added or changed any hardware around the time this problem started? I've seen some IRQ conflicts from machines overstuffed with hardware or with equipment that demands particular IRQ's.
Going back to power supply, if its an older machine the supply might simply be starting to drop in output and all the devices dont initialize right the first time. Once the supply is on for a minute or two, its good. If you've been using the machine for at least 10-15 minutes and reboot windows, do the keyboard/mouse reinit ok or is it just on a cold start?