Connecting two STM32f4discovery boards
Unless I am remembering wrong, the STM32F4 variant on that board does have a USB OTG host interface which could be either a host or device.  In theory it would be possible to make one board a USB host and the other a device and place them in communication, however this would have a fairly high software complexity, and would require an OTG adapter cable.

A much simpler solution would be to utilize a logic-level serial (UART) interface, several of which are present on each board.  This will be orders of magnitude simpler to support in software.  All you will need is to establish a common ground, then connect the transmit pin of each board to the receive pin of the other.  For short cabling runs you may be able to to operate at a baud rate approaching a megabit per second, possibly more.

There are additional interfaces which could be utilized - SPI, I2C, possibly ethernet (with external support parts), etc, but logic level serial will be by far the easiest.