The smell is due to creosote deposits in the chimney, a natural byproduct of wood burning. The odor is usually worse in the summer when the humidity is high and the air conditioner is turned on. A good cleaning will help but usually won’t solve the problem completely. There are commercial chimney deodorants that work pretty well, and many people have good results with baking soda or even kitty litter set in the fireplace. The real problem is the air being drawn down the chimney, a symptom of overall pressure problems in the house. Some make-up air should be introduced somewhere else in the house. A tight sealing, top mounted damper will also reduce this air flow coming down the chimney.