Finally, I was able to solve the problem thanks to the help of GSerg and David Heffernan.
Here is the IDL that will be used to create the .tlb
[ uuid(12345678-1234-1234-1234-123456789ABC), version(1.0) ] library myTypeLib { [dllname("myLib.dll")] module myLib { [entry("myFunc")] int __stdcall myFunc( LPSTR filename_in, LPSTR filename_out, LPSTR ErrMsg); }; };
To compile it, use the "midl" command on the Visual Studio command prompt.
The resulting .tlb file must be placed in the same directory of the VB6 project along with the DLL.
In the VB6 project, in Project-> References, you can add the .tlb file.
If everything went well by pressing F2, you could see "myTypeLib" in the list of available libraries.
Now you can call "myFunc" inside the VB6 project!
However, there are two questions:
1) Some types of variables are not compatible between VB6 and C. An example of this problem is represented by char arrays. While in VB6 they are declared as Dim myStr as String , in C they are usually declared as char myStr[MAX_DIM]; . To make it possible to translate between VB6 and C without modifying the DLL, you can declare strings on the VB6 side as Dim myStr as String * 256 , while in the IDL file, the correspondent string must be passed to the function as LPSTR myStr .
2) VB6 does not bind DLLs until .exe is created. But if the DLL is not connected, then its functions are not visible. For this reason, the entire function of the implicitly linked DLLs that should be used in the VB6 project must be included in the IDL file.
In addition, for the same reason, even after all the functions have been included in the IDL file, it will not be possible to start the program from the IDE (it will crash) in order to debug it. The only way to start the application is to create .exe.