The cost will not be that much as far as lumber etc. goes. I built mine dried in for approx $2,000 more in materials. If you are not doing the labor you can figure around $5,000 for a bonus room like mine. If you are going higher/larger footprint it will be more. The biggest cost for my apartment so far was not building it, but finishing it. I figure I will have $10,000 extra in my garage by the time the apartment is finished.
If you are doing a bonus room, do yourself a favor and add dormers. The dormers really allow for a lot more usable space.
My apartment is now wired, sheetrocked etc. Make sure to figure in extra electrical, plumbing and structure requirements