It's unclear just what you're trying to do. Are you trying to create your own module which accepts plugins, trying to create a plugin module for an existing program/framework, or something completely different?
Then I guess the solution to write a plugin for the existing program/framework will very much depend on what the program/framework is, and how it implements its plugin interface.