So far I managed to get ARM's reference implementation of CMSIS-DAP, taken directly from their DAPlink repository, to build and seemingly properly recognize with Keil v5 with my STM32F042K6T6 board.
Functionality: SWD is not working, JTAG is working but problematic. (Maybe I should increase the JTAG node count?)
Code size: So far the code size is about 23kB with -Og optimization (instead of the aggressive -Os) and RAM usage is about 4kB. Do keep in mind that the chip have only 6kB SRAM and 32kB Flash, so this can be a constraint. I did not use Keil RTE, RTX or STM32CubeMX. This is entirely bare metal with a small USB Stack written by dmitrystu and direct register manipulation for GPIO.
Target: I need two variants of the same firmware: one with SWO and MSC intended for the independent DAP42 debug probe, ant another without SWO or MSC but still have full SWJ and CDC for the STM32F042F6 based DAP42 Embedded variant.