I've recently tested this with a KeeLog USB Keygrabber and a USB Charger Doctor from Adafruit
I noticed the voltage going down about 0.2V upon plugging in the keylogger, but the value didn't seem to be stable enough to use it for reliable detection.
What seemed more stable was the power consumption. With the keylogger I got constantly 0.04 A more than without the keylogger. But so far I was not able to see this difference in power consumption with software from inside the OS, e.g. with
powertop on Linux. But if I have to check the USB Charger Doctor everytime before I use a PC, I very likely will also detect an USB keylogger sitting at the same place or nearby.
Anyway, let's say, we found a way to measure that value from inside the OS.
A sudden rise in power consumption is still no real indicator since hitting Caps-Lock and/or Num-Lock on the keyboard also caused additional power consumption from its LED. And that was in about the same range according to the USB Charger Doctor: 1 LED = 0.03 A, 2 LED = 0.05 A. So the keylogger's power consumption is within an expected range.
So if someone lits all LEDs on his keyboard it could be noticed that the power consumption is higher than it seemed possible. But that's unrealistic in everyday use unless you light those LED from the OS side (which is possible). But I guess regularly blinking keyboard LED would drive the user crazy.
Another way would be to do long-time statistics about this and then notice a sudden rise of the average power consumption level as an anomaly. But I expect false positives here, e.g. one user prefers Num-Lock being off all the time and another user prefers it to be on all the time.
With regards to the hint from the other answer about multiple devices might defeat that: That's right. But quite some USB keyloggers don't support multiple devices (or at least don't support USB hubs) behind them and at least on desktop PCs, the keyboard is often connected directly to the PC.