I do not understand what you want to do.
Do you need to use the C++ API?
When you want to export an agent, you could use NotesDXLExporter to export an agent in Lotusscript. The output will be DXL. And that can be imprted using NotesDXLImporter.
Or you could get the note of the agent (please remember that design elements are notes in a database too) and copy it into another database.