I need to write some code that will
So, in general, instead of producing the VI as a black box, that can be easily implemented with any programming language that can be compiled to DLL, I'd like to deal with LabVIEW's pre-defined VIs' metainformation and to have some LabVIEW project as an output. Is there some API to do it? Google says nothing on it, but maybe there are non-obvious ways to do it?
The API for generating or editing LV code is known as LabVIEW scripting. In recent versions of LV it's an official part of the environment and you can enable it from the options dialog. Keep in mind that it was originally created as an internal feature, so it does have some holes, but it is mostly complete. You can find materials online on working with it. Note that in general, while LV scripting is not particularly complicated, it does require a good understanding of the class hierarchy and modelling of LV block diagrams.
Also, note that if you want a more complex application, LV 2012 and later has a built-in feature which will generate a complete project from a template, and you can create your own templates. This is useful if you have projects with the same structure.