There's no built-in functionality to do what you want, so you're definitely going to have to have something coded.
I can't tell you about Vista or Windows 7, because I don't have one handy right now to test on, but a "shutdown -l" (as phuzion mentioned) on Windows XP run as SYSTEM (invoked by the "Task Scheduler" service) will cause the session for the interactive user to logoff. Conceivably this might be different on Vista and Windows 7.
You could probably rig something ugly with wprompt, a .BAT file, and "Scheduled Tasks", but you'll have to schedule it with the "AT" command to get it to interact with the Desktop, and you'll have an ugly command-promt window popping up. (Okay, okay-- I can think of a way to do it with VBScript and that wprompt utility that wouldn't cause an ugly command prompt window to pop up. It's still ugly, though.)