Literally, “我靠” means “I lean,” which makes no sense as an exclamation. This is because it's a euphemism. It's a sound-alike substitute for the much more vulgar phrase “我肏” (wǒ cào), which means “I fuck.” The character `靠 (kào)` was chosen simply because its pronunciation is very close to `肏 (cào)`. Over time, `我靠` has become so common that it has taken on a life of its own, much like how “shoot” or “heck” are used in English to replace stronger words.
`我靠` is extremely common but strictly informal. Its meaning is heavily dependent on context and tone.