I've seen an interesting argument that interprets the first clause negatively, to the effect of:
Because well-armed militias are (unfortunately) necessary, the right to arms shall not be infringed (so that the people can resist the militia if necessary)
Which, if accurate, dispels any thought of limiting arms only to a government-backed militia