My 15-year old Samoyed girl has pulmonary hypertension and lung disease and exhibited the same type of coughing that you mention. It sounded almost like she was hacking up a furball or something, but it wasn't productive.
It sounds scary to think your dog might have heart or lung issues, but my girl is on twice daily Viagra and Enalipril and has been doing quite well for the past year and a half. The coughing is minimal and she has her energy back.
The only downside to the meds Miss Ivory is on is the fact that the Viagra is incredibly expensive--$15 per pill, but each pill is split into 8ths, so she only gets one pill every 4 days. I tried to get the boyfriend to go to the doc and tell him that he has a "problem" and needs Viagra, but (un)fortunately he's not into insurance fraud...as much as he loves my dog!
Has your vet ever heard a heart murmur during your dog's regular exams? That would be one easy thing to look out for during an office visit and could help point you in the right direction.