Call this function in a loop, with a certain delay (e.g. 1000 ms), and calculate the difference in lpIdleTime, lpKernelTime, and lpUserTime between each pair of successive calls. This will tell you how much time the system has spent in each "state" (i.e. "idle", "kernel" or "user") — during the last time interval.
(Be aware that the value lpKernelTime also includes the value of lpIdleTime, so you will have to subtract lpIdleTime from the lpKernelTime, in order to get the "pure" kernel time value)
I do not know how, where, etc. But somewhere, windows tracks the idle time and uses that to fire up screen savers, lock the screen, etc. I know its out there, and I am pretty sure you can just ask for it, but again, I don't know where or how.
All the online examples show a ream of code to get it done using timers or whatever, so maybe I am just having a wistful thinking moment, but a bit of investigation for a better mousetrap may be in order (and forgive the bad pun).
edit: it could be tied to making use of "GetLastInputInfo"