USB endpoint configuration with FunctionFS

For a new product, we want to use a colibri iMX6DL as a USB device which is not class specific. So I have to configure the interface that we will have 4 interrupt endpoints (2 in and 2 out).
I read your article High performance, low power Embedded Computing Systems | Toradex Developer Center and was able to configure an acm gadget but I think for my problem the Function filesystem gadget ffs would be the right choice. I was able to configure and mount the filesystem, so that the ep0 file appeared.
According to the documentation https://www.kernel.org/doc/Documentation/usb/functionfs.txt a user space driver has to write descriptors and strings to that file (I assume here, the endpoints can be configured). After that, the other endpoints will appear. Unfortunately, I could not found an example of such an user space driver. Do you have an example how to configure the endpoints or is there a better way to make a customized usb device.
Our device shall be compatible to an existing windows usb driver. That’s the reason, why we can not use an acm gadget for example.
Any help would be appreciated.

Hi

AFAIK we never did something with FunctionFS.
The kernel sources however contain user space code for FunctionFS, have a look here:

http://git.toradex.com/cgit/linux-toradex.git/tree/tools/usb/ffs-test.c?h=toradex_4.1-2.0.x-imx

Max