Use "compared to" to point out similarities between things:
RAM can be compared to ROM in that both involve memory storage.
Use "compared with" when noting both similarities and differences:
By way of Bernoulli's principle, the mechanics and function of a dragonfly's wings can be compared with those of a dolphin's fins.
For further discussion of usage issues related to making comparisons, see Grammar Girl's handy "Between," "Compared to," and "Compared with" discussion.