How do I properly procedurally add components in C++?

For garbage collection and memory management by the engine.