Hi,
I know that the sentence: "The angry boy ran out of the room slamming the door as he went" is correct, but I cannot explain why.
'Slamming' is used here as an adjective describing the boy. Think of 'a galloping horse'. What you are really talking about here is 'a slamming boy', not 'a slammed boy'.
I'd put a comma before 'slamming' in your sentence.
And, in the sentence: "The angry boy ran out of the room and slamming/slammed the door as he went", which word should I use, slamming or slammed?
Here, you are joining to separate clauses with 'and'. Each needs its own verb, in the past tense. What you are saying is The angry boy ran out of the room and he slammed the door as he went.
Best wishes, Clive