This may be a little bit late to respond. I am a real estate attorney and practice in zoning, transactions, and litigation. The answer to your question is that it all depends on the zoning code. Some towns allow such apartments as an accessory use. If it is a "permitted" use then you should not have as much trouble since it is permitted under the zoning code as a permitted use. If it is a permitted use but you need to build it, you likely need to get a site plan approval to show that you meet the other regulations (ex. height and bulk requirements). Often times this can be done administratively.
If it is not a "permitted use" it becomes more complicated. If it is a specially permitted (or excepted) use, you need to go before the P & Z Commission (which holds hearings weekly) and demonstrate that the proposed accessory apartment does not negatively impact public health and safety (as further defined by the regulations). If it is not a permitted or special excepted use, then you need to apply for a variance, in which you need to demonstrate a hardship, which is not easy.
Regards,
Ed Schenkel, Esq.