You need to make a component that implement TTSEngine API, see the documentation for details:
TTS Engine Vendor Porting Guide
For a practical example of the engine implementation you can download sample engine as well as you can check Espeak SAPI implementation.