The average cost of heartworm treatment for dogs can be upwards of $2,700 — and potentially thousands more if surgery is needed. If your pet has been diagnosed with heartworm, treatment varies greatly depending on whether you have a dog or cat.