Broadly, both are interchangeable. However, if you still want to dig it deeper, I'd give my choice/preference.
talk to someone
is more kind of monologue where you speak more and whom you are talking to listens more.
On the other hand,
talk with someone
is a kind of dialogue between two where both almost equally participate.
To elaborate, let me think of an example -
I'm a team leader and if A from my team comes and 'complains' about B, I may say,
Okay, I'll talk to B.
What I mean is I'll raise the issue and probably instruct B not to do such things in future. Mostly, I'll speak and B will listen.
However, if my boss calls me and asks to implement some new strategies across the teams, I'd probably say,
Okay, I'll speak with my team members.
It'll have a fruitful discussion probably each one of my team will participate and give their inputs.
But, as I said earlier, largely, both are interchangeable with no big difference in most of the cases.