A man in his 40s was shot dead by police after barricading himself and presenting a weapon.