Looking for advice on building a USB inline device to remap CapsLock key on USB keyboard
You need to build a product that has both: a USB device interface and a USB host interface.

USB Device interface (keyboard emulation)
The PC (host) wants to see a keyboard (device) attached.

USB Host interface (PC mimic)
The keyboard (device) wants to talk to a PC (host)



The problems are the USB software stacks
You need to have the source code of a HID USB device software stack to emulate a keyboard.
You need to have the source code of a USB host software stack in order to talk to the keyboard.
Afterwards, you need to slightly modify the HID device software to fit your needs.

I think that Microchip and NXP have the right microcontroller and the software stacks.
Their software stacks are open source but you have to use them in their microcontrollers.