The signalling is somewhat complicated. You first have to check for passive resistor pin strapping for 5V current limiting, then check the cable for an electronic ID chip, then communicate with the remote end through a pulse-width signalling protocol, keeping in mind that the other end may want to be a PD source, sink, or either, and you have to consider that CC1 and CC2 can be inverted. You also need to switch the power supply, as USB type C does not allow connecting the 5 V Vbus until the remote side is detected.
It's nothing you couldn't do yourself with a micro-controller, but its probably a lot easier to use a stand along PD controller such as the STUSB4700 series, or any number of TI products.