One quick way to do this is to enable a hot corner for your screensaver in System Preferences and then tick the box in the Security pane that says a password is needed to get out of a screensaver.
I usually enable fast user switching, and then select "Login Window" from the user dropdown menubar item. I also have a simple one-line AppleScript mapped to a keystroke in QuickSilver that accomplishes the same thing.