For residences, IRC 2006, M1507.3 requires a bathroom or toilet room to have "Mechanical exhaust capacity of 50cfm intermittent or 20cfm continuous." IRC sets no requirement for how this is implemented, only that the capacity must be there. Same switch, separate switch, humidistat, timer, etc- all OK by IRC.
Commercial is different. IMC 2006 400.3 requires commercial bathrooms in dorms, hotels, etc, to have 35cfm ventilation/person. (Continuous is implied.) As 0 people are in the bathroom when the lights are off and 0cfm required, the fan can be tied into the light switch. I'm not familiar enough with IMC to know any other subtleties of the code, or what specifically applies to restrooms in stores or offices.
I always seperate fan and light, unless HO wants both together. No violation of NEC in residential. I used spring timers when my daughters (4) were still at home. Now, we just use regular swiches so we do not have to listen to the fan until it times out.
I was told in MA the building code states the fan has to come on with the light if there is no windows in the bathroom. I seperate then unless the owner wants them on at the same time. In a half bath I like the fan on with the lights and using panasonic you can't hear them anyways