Since mini2440 has both USB host and USB slave, can I connect these two ports with the provided cable? I plan to write one USB gadge driver (for the USB slave) and one device driver (for the USB host) to let them communicate.
Yes, you can do it.