How to use map.addControl()

For the map.addControl() function, can I add a custom plugin to it or do I have stick with tomtom’s plug-in. Also, I can do my own plug-in, how do I do that?

General idea is that we are offering our plugins and it is not documented how to create a custom one.