An average Cary single family home will probably command an annual premium in the $450-$650 range, depending on riders and valuation of home.
Townhomes can range widely, depending if the HOA is responsible for building maintenance, and if they carry a master insurance policy on the structures. That policy premium would be built into your dues.
Similiarly, a condominium will have the master insurance policy on the structure.
With a master policy on the structure, you will need to carry insurance on the items in the structure that are your responsiblity, cabinets, floor and wall finishes, etc and liability insurance..
I would think that that supplementary policy would cost you in the range of $125-$250 annually, depending on riders and limits.
Those numbers are educated guesses.
The recommendation to contact an agent and get a quote for the specific property is good advice.
It is very subjective to the property, location and the person who is getting it's past history of claims. Also condo's are usually different because the HOA usually includes structure insurance, so you are simply paying for contents. I would get a few estimates. I would be happy to give you our companys contact info, as they shop the major insurers and give you the lowest cost.