In order to avenge Hank's death as well as not allow the Nazis to benefit from all of his work, Walt, wearing his Heisenberg hat, will take down the Nazis. This will parallel the destruction of the Cartel from Season 4. Nazis=Cartel, Walt=Gus and and Jesse=Gus' Pollos Hermanos partner. As reference to the foreshadowing from a previous episode, where Walt and Flynn watch "Scarface" and Walt says "in this one everyone dies," Walt will kill all the Nazis in a blaze of glory with the M60. Walt may get shot during this scene but will survive.
Because no one is smart enough to take down Heisenberg except Heisenberg himself, Walt will take the ricin before killing the Nazis. After killing the Nazis, he will contact his family one last time, knowing the police will track the call and that he is in essence turning himself in. As the police approach, he'll lift his hands over his head and keel over and die. His family will be there to witness it and be relieved. It won't be apparent whether it was the ricin or the cancer that ultimately got him.
I also expect some type of amazing confession video outlining all the brutal things he's done, explaining the reasons he did them and his love for his family. The tape will discuss that Jack killed Hank, despite Walt's pleas against it. The tape will leave them at peace, knowing Walt was a well-intentioned monster whose actions lead to Hank's death, although he did not kill him directly, as well as many others.