Basically you ask about ABI.
In some cases (for example, Itanium) there is a document that is indicated by the ABI, and essentially everyone follows the document.
In the case of DirectX, this is a little the same: Microsoft has published specifications for COM, so anyone who follows these specifications can interact with almost any COM object (within reason - the 64-bit compiler is probably not working with 16-bit COM object written for Windows 3.1).
For most other things, you are more or less on your own. Often, at least, a little is published in the documentation, but, at least in my experience, it often looks at some details that are ultimately important, is not updated completely reliably, and in some cases is simply incorrect. In most cases, it is also poorly organized, so you can very well understand what you can, wherever you find it, and when you run out of information (or patience), do some reverse engineering to fill in the missing parts.
Edit: for non-commercial things like Qt libraries, you have several options. One of them is linking to Qt libraries statically, so the Qt code you need is directly linked to your executable. If you want to use a DLL, then yes, you are pretty much stuck in distributing one with your application, which will be specific to the compiler that you use to create the application itself. Another compiler (or even another version or set of compilation flags with the same compiler) usually requires a different DLL (possibly the same source code, but built-in to change the compiler).
There are exceptions to this, but they are pretty much similar to those described above. For example, the Intel compiler for Windows typically uses the Microsoft standard library and can use most (if not all) of the other libraries created for the Microsoft compiler. This is largely due to Intel leaning back to ensure that their compiler uses the same calling convention, name change scheme, etc., like Microsoft. This works because they put a lot of effort into getting it to work, and not because of any unwritten laws or something like that.