Like Dillinger I tell HR to let applicants know that we are a casual office and that they are welcome to dress comfortably. It's always interesting to see what people's definition of "comfortably" is.
One trick I used ten years ago when I was job hunting was to have either my girlfriend or a friend walk into the company I was interviewing with a couple of days before the interview pretending to be unable to find a nearby address. That way I got an idea of how to dress.