Relative velocity problems are handled in a similar way in two dimensions - it's just harder to add and subtract the vectors because you have to use components.
Let's change the 1-D example to 2-D. The truck still moves at 40 km/hr west, but the car turns on to a road going 40 degrees south of east, and travels at 30 km/hr. What is the velocity of the car relative to the truck now?
The relative velocity equation for this situation looks like this:
vCT = vCG + vGT