Let's say I'm playing the chords D, G, A and Bm. I know that D is my key, which would be Roman numeral I. How do I associate the other chords with their proper roman numerals? How would I determine this if I did not know the key?
The other chords get Roman numerals based on the key you are in. For example in the key of D major you would have the following Roman numerals map to the following chords:
D Em F#m G A Bm C#dim I ii iii IV V vi viio
When you don't have a key try and figure out what key fits the chords best. For example if you had the progression C Am G C there are two possible keys that it could be (technically 4 because of relative minors). Both the key of G major and the key of C major have the chords C, G, and Am. The analysis for them however is much different with the analysis in C major being I vi V I and analysis in G major being IV ii I IV.
In this case the best fit is C major because in general a progression will more likely end on I than IV. There are other reasons why C major is a better and I suggest reading up on harmonic analysis to learn more about it.
In addition to Dom's excellent answer, you might find this chart helpful and handy. It came from Guitarteacher.com. There is also a similar chart for only the most common keys used for guitar. Find it here Major Scale Guitar Chords with Roman Numerals