The creation of a DSP, especially one as large and complicated as a formant preservation DSP, is a bit outside the scope of this forum. It requires an understanding of psychoacoustics, deciding which formants to preserve, and the actual C++ know-how to create such a DSP.
You might have more luck searching for assistance in a C++ programming forum somewhere.