Escape usually does it for Panels (Windows that have the smaller control buttons). Its really up to the developer though, they can change/override those shortcuts (like iCal's panels typically require you to use Cmd-W), even inadvertently, but generally just hitting Escape will nix them.
The other thing, if they're "Inspectors," as has become the prevalent term for them throughout OS X, the shortcut key used to call them is typically able to dismiss them as well. See the CMD-ALT-I inspector in Finder, Cmd-I Inspector in Preview, etc.
There is generally a rhyme/reason to these (but again, not always, its up to the developer). If the inspector doesn't pull focus from the parent window (ie. if the inspector's buttons are red, but so are those on the window that owns them) use Escape. If the Inspector's buttons are lit up, but the parent Window's are dimmed, i.e. in iCal, then the panel is being treated as a full window.