In order for the Raspberry Pi to be recognised as a USB peripheral (which a hub is) by another computer, it would have to act as an USB slave. The Raspberry Pi B can only act as a USB host, so you'd have to use a Raspberry Pi Zero or A for acting as a USB slave.
However, the real problem is that the Raspberry Pi can only act as either a USB slave or a USB host at a time. Now, for your application, you'd need it to act as a USB host to the USB peripherals attached to the Pi and as a USB slave to the computer.
This means that forwarding the RPi's USB ports will never work. What would work is emulate different USB devices on a RPi 0 or A. This can be accomplished by setting the Pi to USB gadget mode. I suggest you Google that term if you're interested in that solution.
I'm afraid I don't know whether what you want is possible with a different SBC. You'll have to look for boards that have two separate USB host chips / root hubs (one for the slave side and one for the master). Arguably, you could add one via GPIO, eg via SPI, though that would likely be a lot of work to integrate on the software side.
If you don't need the Pi to work exactly like a hub, you could forward USB devices over the network. For that, you'd have to make sure Pi and computer are on the same network and install some software on both devices. It seems like a software called VirtualHere (commercial) could be used here.
Update: In the meantime, the Raspberry Pi 4B was released. It is the first Pi to actually include two USB host chips: A new USB 3.0 hub was added via PCIe, but the existing USB 2.0 OTG functionality was kept and routed to the USB-C connector normally used just for providing power. This means it could now actually be used in the way you imagined.