My old Latin teacher jokingly taught that it's all based on hands. I for a single finger; V for the shape of the space between the thumb and the fingers when a palm is put up; and X for the shape of two hands crossing.
It's a cute theory, but really the numerals come from Etruscan. The standard article is Paul Keyser's 1988 article "The Origin of the Latin Numerals 1 to 1000" in AJA 92.4. (If you do not have access to JSTOR, Prof. Keyser actually put it on his Academia.edu page.) Therein he summarizes both ancient and modern hypotheses of the origin of Roman numerals. I won't get into the ancient ones, because they're frankly just not worth it. In fact, Renaissance theories weren't very much better, either.
The reality is that Latin numerals come from late Etruscan numerals. The shape of 100 and 1000 (C & M respectively) is misleading: the Romans inherited the shapes, but certainly made them exactly as they were due to the influence of the letters. They're originally Etruscan shaped, though, which are as follows:
1 = I
5 = Λ
10 = X
50 = M (general shape; the unicode character would be 𐌣)
100 = Ж
500 = Ð
1000 = ⊗
1/2 = >
I represents a single stroke. That much seems indisputable. X and Ж are "second" and "third rank" symbols, i.e. each new stroke times the base number (I) by ten. Five and fifty are the bottom half of X and Ж to represent half the number. These were borrowed in Latin inscriptions, all identical except inverted. (It helps to remember that there was no standard order of writing Etruscan; it could be written in boustrophedon or even upside-down. The entire Latin alphabet just looks like a mirror of Etruscan letters as they're typically written, so at one point one direction became codified in Latin, including these numerals.) Fifty (that W looking symbol) over time slowly morphed to L, though the original symbol is "well attested in Latin) (Keyser, 544).
Keyser hypothesizes that the C shape came from an abbreviated form of Ж, partly due to the fact that > was used for 1/2. The more rounded C shape then evolved under influence of centum.
1000 is easier to see. Keyser notes:
The Etruscan ⊗ or ⊕ = 1000 became (X) when written quickly (note that O is a two-stroke character ( ) and the circle of ⊗ would no doubt be written as O as written). The form (X)...written cursively would lead naturally to the well-attested Latin form ↀ. This "horizontal-8" figure can also appear in a "compressed" form oo which leads naturally to the well-attested formal Latin numeral ⌽. Although the development of Etruscan ⊗ to Latin ⌽ is not obvious at first glance, every step is attested in Latin.
Some of these characters, especialy 'oo' and '⌽', look different in Keyser's article, which I suggest everyone read.
Finally, for 500, the older symbol was Ð, not D, which is, as it looks, half of ⊕.