From what I understand, coughing stuff up is a good thing after quitting. It's the lungs healing themselves and clearing out the built up tar and such. It happens to most people regardless of their method of quitting. I used to work in a retail e-cig store and had a lot of people think the e-cigs were causing a problem because of the coughing, but it went away for everyone after a few weeks and then they reported to me that their breathing improved dramatically.
I went through the coughing thing when I quit cold turkey, but not so much when I quit again with e-cigs but I hadn't been smoking again as long so I may have gotten most of it out the first time around.