Zoning is generally handled on the local government level, so you'll usually find the zoning rules for a given town/city/etc. in the jurisdiction's municipal code. So one way to get a zoning code is to get the online or hardcopy version of the relevant municipal code (see "Local Laws"). The zoning code may also be posted on the relevant jurisdiction's planning department's web site.
Alternatively, you can often get zoning rules by calling the municipality's central switchboard and asking around. They usually sell them separately.
You can also often find zoning codes at the relevant local, county and state libraries.
Treatise: A leading zoning law treaties is Rathkopf's Law of Zoning and Planning (West Publishing).
New York City: NYC zoning rules are published in a 3 volume set called Zoning Resolution: The City of New York. The Resolution is posted on the Internet by the Department of City Planning (text at www.ci.nyc.ny.us/html/dcp/html/zone/zonetext.shtml, maps at www.ci.nyc.ny.us/html/dcp/html/zone/zh_zmaptable.shtml).
The Zoning Handbook: A Guide to New York City's Zoning Resolution is a helpful aid to the Resolution. The Handbook is posted by Tenant.net. You can buy print copies from the
City Planning Map & Bookstore.