First you need to choose a microcontroller which provide USB Host port. AFAIK you can find this kind of support on high end microcontollers only and its not possible to provide a generic solution until you finalize the micorcontroller.
I agree with you Budhy, here is the quote from datasheet where it clearly mentions that USB host is required on other side.
The PIC18FX455/X550 device family contains a
full-speed and low-speed compatible USB Serial Interface
Engine (SIE) that allows fast communication
between any USB host and the PIC® microcontroller.
I know that the MCU's I mentioned above don't have USB host controllers. That's why I'll use the MAX3421E or any equivalent. But, I'll still need to write the driver of the USB Bluetooth dongle I have.
if you want to write a usb driver for PIC18FXXXX you can use Mikroc compiler it make a simple driver for this MCUs but this compiler creat an slave driver for you and you need a host driver too. i think this site will help you for writing the host driver www.usb.org
Thanks very much for your help. I'm know about the host/peripheral issue. I'll use the MAX3421E as a host but I still need the driver of the Bluetooth dongle.
I working now on the MikroC compiler, However it will take some time to get used to it.
Thanks again my friend for your help.
I found that the MikroBasic 5.0.0.2 have the same USB_HID library that MikroC have.
Attached here is the code I found for a USB connection however, this code is written for an HID.
Also, it's only the intialization, there's nothing mentioned about how to write a driver.
I have question:
The code says that there's a sequence of numbers is sent to the PC via USB cable. How will I receive this sequence? I can I check it?