It depends on how bad the heartworms are. The cheapest way to treat would be to keep the dog on heartworm preventatives. The problem with that is that treating the dog with just preventatives takes a really long time to clear the heartworms. So the heartworms are still hurting the heart while you treat.
I got a dog about a year ago that already had high-antigen heartworms. I got her in the summer, and my vet suggested not treating her until it cooled off. We just kept her on heartworm preventative and then had her treated in November.
I'm not sure of the price of the treatment, as our vet was my girlfriend's aunt and just charged us the cost of the Immiticide. It is costly though. But, once treated, the success rate is really high, so it's worth it.
Here is something I pulled from the internet about treatment.
There are three conventional methods of treating heartworm: a "fast kill" method using Immiticide (melarsomine); a "slow kill" method using Heartgard (ivermectin); and a surgical method, where the worms are surgically removed from the arteries. In addition, there are so-called holistic treatments, such as Paratox homeopathic or herbal preparations.
Immiticide (Fast Kill)
This is the method preferred by us for dogs beyond stage 1 of the infection. Standard treatment with Immiticide consists of giving two injections 24 hours apart, then keeping the dog strictly confined for the next four to six weeks. The injections must be given in a painful location — the muscle close to the dog’s spine in the lumbar (lower back) area. The worms start to die immediately. As their bodies begin to decompose, pieces are “shed” into the dog’s bloodstream and filtered out through the dog’s lungs. This can cause the dog to cough and gag, or lead to a fatal pulmonary embolism.
The dog must be kept confined and his physical exertion kept to an absolute minimum, in order to prevent pieces of the dead worms from being forced by a rapid heart rate and/or increased blood pressure into clogging the tiny blood vessels in his lungs, causing embolisms. This generally means that the dog must be kept crated or penned and allowed out to potty only on a leash. Aspirin may be prescribed to lower the risk of blood clots, though this is controversial. Remember that it’s dangerous to combine aspirin with any other nonsteroidal anti-inflammatory drug (NSAID) or with prednisone, and to give it only with food.
Heartgard (slow kill)
The "slow kill" method, which is a newer approach, is the one prefered by us for treatment of dogs who are in Stage 1 of the infection. It consists of giving the dog Heartgard on a monthly basis. This heartworm preventative medication has some effect against the adult worms and should gradually eliminate them over a period of one to two years; without treatment, the worms can live up to five years. The earlier the treatment is started after infection, the more quickly it will work to eliminate the adult worms. Note that only Heartgard (ivermectin) should be used, as Revolution (selamectin) affects far fewer adult worms, and Interceptor (milbemycin oxime) almost none at all.
Although this method is gentler than the use of Immiticide, the danger from the dying worms is still present, and for a much longer period. A recent Italian study showed that pet dogs (as opposed to the caged laboratory dogs this method had been tested on before) did get pulmonary emboli and some of the dogs died of it. The more active the dog, the higher the risk.
Surgical methods of heartworm removal require specialized training and instrumentation, and are generally reserved for high-risk patients who would not otherwise be expected to survive. The surgery is followed by one of the more standard treatments a few weeks later to kill any remaining worms.