Although there are ways of generating structures from NBT files Minecraft uses min and max x, y, and z coordinates to decide which blocks go where. The StructureVillagePieces class is an example of this. In order to create a new village component (building) create a class that extends StructureVillagePieces.Village which will be your code for the building itself. An example of this can be found here. You will also need to create a handler the implements IVillageCreationHandler in which you will refer to your new village component class. In your main class preInit you will then need to use
VillagerRegistry.instance().registerVillageCreationHandler();
to register your handler and
MapGenStructureIO.registerStructureComponent();
to register the component itself.
If you want to create an entirely new village instead of single buildings I recommend looking at Galacticraft's code for Moon Villages.
Although I haven't look into them much I imagine End Cities and Woodlands are similar to this.