@f5soh can probably help more than me, but here are some guidelines. If you can get the RPi to send PWM or PPM (or other) signal to the CC3D, then the CC3D will think it is connected to a normal RC receiver. This is an easy way to understand, but it may be difficult to get RPi to send these signals without jitter. Needs a system level driver, not bit banging, probably PPM. Flying in Attitude mode this could command bank angle and throttle. RPi would probably need a GPS, etc.
There are ways that the GCS can control the CC3D through telemetry; you can have the RPi send telemetry packets to the CC3D. Figuring out these packets is difficult. I don't know exactly what to do and it would take a while to figure it out.
There is a way to write Python code (maybe something besides Python, I forget without digging) and have it run in Revo. I don't think this is available in CC3D though. You could send serial data that is read by your code and have it do some calls that are similar to the previously mentioned telemetry, but are more packaged and easier to do?