If a druid where to turn into an ape and use a longsword to attack, would his Primal Strike ability allow that attack to overcome resistance and Immunity to non-magical attacks and damage, or does Primal Strike only apply to the natural attacks the Beast form has?
I just double checked Primal Strike, and I believe RAW you could use a "weapon you're proficient with" (longsword isn't one of them, but a scimitar is) because of how wild shape works, as long as the beast has the ability to wield it.
Player's Handbook, page 67, under Wildshape:
Your game statistics are replaced by the statistics of the beast, but you retain your alignment, personality, and Intelligence, Wisdom, and Charisma scores. You also retain all of your skill and saving throw proficiencies, in addition to gaining those of the creature.
And since you can wield weapons as an ape because they have thumbs, and you have the intelligence to know how to use a "weapon your proficient with" you should be able to use Primal Strike with your weapon attacks. (Although this isn't broken, it does seem rather weird, so I'd still suggest asking your DM about this before attempting it. The worst he can do is say no.)