Is only one of them correct? Are they used in different situations? Or are they interchangeable?
From Strunk and White:
Use "compared with" when you are looking for differences.
E.g. CEO’s now earn 419 times the pay of blue-collar workers, compared with 42 times their pay in the 1980's.
Use "compared to" when highlighting (or comparing) the similarities of one thing to another.
E.g. The human heart can be compared to a pump.