If your dog has become already infected with heartworms then the treatment cost for the heartworms from the vet is between $400.00 to $1,000.00 which would usually come out of pocket unless you have pet health insurance to cover the cost of the heartworm treatment.
If you treat the dog for heartworm at home to prevent them from getting heartworm then it averages out at a cost of $15.00 to $30.00 per month for the heartworm medicine.
However I would not recommend giving your dog heartworm medicine unless they absolutely need it because the heartworm medicine can cause other health issues and could shorten your dogs life.
A dog will usually get infected with heartworm after being bitten by mosquitoes so if your dog has been bitten by mosquitoes then it can get heartworm and then you should give the dog heartworm medicine or take the dog to see the vet.