First, the concept of killing a non-guilty party in self defense is learned from the Gemara in Sanhedrin 82a. (See also the commentary of the Rosh to this Gemara; 9:4) When Pinchas was (doing the right thing; hence not guilty; see Numbers ch. 24) chasing after Zimri, to kill him with a spear, the Gemara explains that Zimri was allowed to kill Pinchas in self defense, since as far as he was concerned, Pinchas was a "rodef" (a Halachic "assailant" bent on taking Zimri's life). It did not matter that the Halachah sided with Pinchas and allowed him to stalk Zimri to save the Jews from the plague etc.
However, the OP is also asking in its title question, if one may kill A to protect from B. This implies 3 people in the equation.
B is chasing C to kill him. Meanwhile, C has the opportunity to kill B in self defense, by killing A in the process. May C do so, even at the cost of innocent A's life?
The first basis for such a case would be found in the Tosefta of Terumos at the end of chapter 7. If bandits threaten a group of people and say: "Give up one of you to be killed or we will kill all of you." They may not surrender anyone and must willingly accept being killed.
However, if they say: "Give up so and so, and we will spare you all; or else we will kill all of you.", then they should surrender that one named person and avoid death of the group.
This was the case in II Shmuel 20: 1-22. The people of Aveil, surrendered Sheva ben Bichri (by killing him themselves) to General Yoav to avoid a siege. (Although Sheva was guilty of rebelling against King David, one may argue that as far as the people of Aveil were concerned, he wasn't trying to hurt them.)
(However, R' Yochanan in the Yerushalmi (Terumos 8:4) contends that the leniency to hand over one named person to be killed applies to any innocent. Resh Lakish on the other hand, says it only applies to someone like Sheva ben Bichri who was guilty of treason against the king. In general, the Bais Yosef decides like R' Yochanan (siding with the Smag and other Rishonim), but the Rambam holds like Resh Lakish. The Rema brings both opinions for discussion. See Yoreh Deah 157:1)
A more direct case is discussed by R' Yitzchak Zilberstein (Rav Elyashav's son-in-law) concerning a case where Reuven is being chased by assailant Shimon. May Reuven throw a grenade behind himself at Shimon, knowing that the blast will also kill Levi(an innocent bystander)?
Rav Zilberstein quotes an authority (named "Damesek Eliezer" who says in the name of his father) that says one definitely may throw the grenade even if it will kill both the guilty assailant and the innocent bystander, if it will save his own life. A person has that license.
However, another case is even more direct. In the Arab - Israeli wars, Arab troops would sometimes take Jewish prisoners and use them as human shields while advancing towards Israeli lines. They would force the prisoners to yell "Shma Yisroel" so the Israeli's would realize they were Jewish shields.
May the Israelis fire upon the advancing Arabs who were using the Jewish comrades as shields?
In general, if someone is told: "Kill him or I will kill you" we say that one must rather be killed than commit murder because who says your blood is redder than his? (See Sanhedrin 74a; Rambam Hilchos Yesodei HaTorah 5:7)
The Knesses HaGedolah (in a comment on the Bais Yosef to Yoreh Deah 157 (note 38)) brings the opinion of the Meiri who explains that even if the person is told: "Kill him or I will kill you both" one may surrender the other fellow, but may not actually kill him directly.
So it would seem then that the case of human shields would not allow the soldiers to fire upon the advancing "shielded" Arabs?
Rav Zilberstein explains that one could not rely upon the lenient opinion of Damesek Eliezer's father here, because the grenade blast indirectly kills the bystander. Here, the soldiers would need to shoot directly at the shields.
So we understand that using a high velocity round that would pierce and kill the human shield captive, and also kills the Arab behind him would be forbidden under a hostage situation.
However, Rav Zilberstein does give two possible reasons to allow the friendly troops to open fire:
1) The Israelis are aiming for the Arabs and not the shields. Even though it is highly risky, the Israeli snipers may fire since they have a chance of not killing the shield hostages.
2) Times of war may be different, and allow for the usual rules of Halachah to be suspended.
II Shmuel 11:25 "And David said to the messenger, "So shall you say to Joab; Let not this thing displease you, for the sword devours many time this number; strengthen your battle against the city, and destroy it, and encourage him."
Rav Zilberstein interprets this verse to likely be a comment upon casualties of war and a blanket leniency (heter) that during wartime, one may try to win even at the cost of collateral damage.
He says that this concept may have been the underlying heter relied upon by Rav Michael Dov Weismandel, when he urged the US government to bomb the train tracks and death camp facilities of the concentration camps, even though such actions would risk killing many camp victims. This could be done in order to save the masses of Jews being killed during the war of the Holocaust.
In General, we do see a Halachic path here and sources to consider, but Rav Zilberstein expressed doubt during his shiur about any truly particular case and expressed that such matters would require further study on a case by case basis.
May they never come up in practical reality. :)