I’ve built several custom content types for Confluence Server and I do not think there is any official documentation for it. Maybe one day I’ll get around to posting some sample code.
I learned most of what I needed to know by “creatively investigating” existing plugins that implement custom content types. Unfortunately it is not the most straightforward process.