The requirements for self-defense in the U.S. are very simple and logical[1]:
1. You must be (or believe you are) in imminent danger of harm
2. Your response must be proportional to the threat
3. You must not be initial aggressor
4. Your decisions must be reasonable based on the information you had available to you
A few states also impose what they call a "duty to retreat", which basically means you must have exhausted all safe avenues of retreat before resorting to self-defense. Most states have removed such requirements because determining whether or not that criteria is met is really hard and doesn't really add much to the other four criteria.
Whether a gun was used doesn't really matter: dead is dead. Using a gun doesn't make them more dead. If you were justified to use deadly force, then the means shouldn't really matter.
[1] I am not a lawyer, but my knowledge of self-defense law comes from attorney Andrew Branca and his book Law of Self Defense