Unfortunately I can't give you an absolute fix, but I think I can shed some light on this problem.
I experienced the exact same issue with a four year old HP Compaq dx2400 running Windows 7 Pro. I noticed that during the BIOS boot the keyboard responded appropriately - I could even hit F10 and enter setup. When I did I checked that the USB ports were
still set to active, so it wasn't a hardware or BIOS problem. It is absolutely a Windows issue because as soon as Windows took over the keyboard and mouse went dead. Luckily for us this PC has PS/2 ports and I happen to keep some old keyboards and a USB-to-PS/2
adapter around. When I hooked up the PS/2 devices the PC booted normally.
Now, two significant things: 1) the PC is joined to a network with Windows Server 2008. When the PC booted I logged in with an administrator account, and not the same user account that had been on before. 2) As soon as the PC booted there was a message
window stating that the PC had to be rebooted in order for recently installed updates to complete installation. So there were some lingering updates that were halfway installed at the time that the PC last was shutdown (and I don't know if this was manually
by the user or "automagically"). I also don't know if part of the issue was that the user account didn't have the authority to allow these updates to be applied. In any case, I rebooted to allow the updates to complete, then shut the PC down hard, disconnected
the PS/2 devices, reconnected the USB devices, started the computer, and everything worked normally.
So, again, this is absolutely a Windows problem (and I find the response from Mohammad_Imran pretty lame - it's like telling a mechanic that your car won't start and he says to drive it over so he can take a look at it). It also seems to have something
to do with partially installed updates. In this case the updates were in the categories of "Security Update for Win 7" (KB2862330, KB2864085, KB2862335, KB2884256, KB2876284, KB2847311, KB2883150, KB2868038, & KB2864202), "Update for Windows" (KB2888049,
KB2882822, KB2852386, & KB2846960), "Security Update for Microsoft.NET Framework 3.5.1 on Windows 7 SP1 x86" (KB2861191, KB2863240, & KB2861698), and "Cumulative Security Update for Internet Explorer 10 for Windows 7 Service Pack 1" (KB2879017). Four of these
updates had actually failed on install the day before (KB2864085, KB2862330, KB2862335, & KB2888049) all with error code 80070490. Now the specific updates that others may have will probably differ from these, but I would bet that there is an underlying problem
that Microsoft needs to look at.
So if you are lucky enough to have PS/2 ports on your computer there is a workaround. If you don't the good news is that your machine isn't toast, you just need to repair, restore or reinstall Windows. Just test first to see that your keyboard works with
BIOS setup before it goes dead, then you'll know for sure.