Hi. I have discovered the same thing. I work at a school where we have 50 iMacs, and have found that the latest of these that we have bought, have started doing this. At first I thought it was just students wrecking the keyboard cable, but because it was happening so often, started to suspect the USB plug connectors. Sometimes it was possible to go and plug the unrecognised keyboard into the machine next store and it would work!!!
I decided to try cleaning the USB plug contacts as best I could, but this didn't really solve the problem. Then I thought I would try using the Apple USB extension cable that came with the wired keyboards, as I knew they had a very 'firm' connection and made excellent contact.
Bingo, two newish keyboards that I was ready to bin, suddenly were working again!
This confirms to me that a lot the issues that people are having are 'driver' or power related, but are simply that the USB plugs are not making contact with the USB port on the back of the iMacs.
I believe Apple has a problem here, as it only seems to be the keyboards from our newest machines that are having connection problems. Either the pins inside the plug are wearing very quickly, or are recessing into the back of the plug somehow so they are not quite contacting firmly, if at all.
Hope this helps
SurfDive45