I was working on similar problem, when up to 4 cdc devices could be attached to Tower usb cdc host via USB HUB.
The thing is that because we attach multiple usb devices of the same class, the usb host stack calls the same callback functions (usb_host_cdc_data_event() and usb_host_cdc_acm_event() as registered via USB_HOST_DRIVER_INFO structure) for all of them.
The assignement of file names to the attached devices is done at application level. It is in usb_host_cdc_data_event callback for the USB_INTF_EVENT case, by calling function usb_class_cdc_install_driver(data_parser, device_name)), where the device_name will be one of the file names.
So, we need to implement a solution at application level to assign "tty0:", "tty1:" ... "tty4:" file names to attached devices dynamically, and close the files when a device is detached.
My solution was based on the order of attach. I specified for my application, that the 1st attached device will be "tty0:", second "tty1:" and so forth. Then I modified the communication task in such a way that it reads/writes from/to the attached devices. When a device is detached, the corresponding file is closed and removed from a list of attached devices. I have a demo for this - modification of the default MQX demo /usb/host/examles/cdc/cdc_serial - to support 2 attached cdc devices via usb hub at one time, I think it can be extended to 5 quite easily. If you compare the attached cdc_serial.c with the MQX 4.0 default cdc_serial.c you will see differences.