First off, it's indeed with, not to. You lodge, or file, or register, or raise a complaint with someone. However, you can also submit, bring, take, or send it to someone.
Here are some stats from the Corpus of Contemporary American English just to drive the point home:
filed a complaint with/to 131/1
file a complaint with/to 42/2
filing a complaint with/to 11/0
lodged a complaint with/to 6/1
lodge a complaint with/to 5/0
files a complaint with/to 4/0
lodges a complaint with/to 1/0
Why? There is really no why, especially not when it comes to prepositions. One is idiomatic, the other one isn't. You learn to use with from your mom because that's what she uses. And she in turn learned it from her mother. That is all there is to it.
This is not really too different from how you use "a car" to mean "a car". It might just as well have been "uma João". But you say "a car". And prepositions in particular are more idiomatic than anything else. They do not have to follow some logic, and indeed often don't. In every language, not just English.
And one last thing. You say "the definition of 'with' is 'accompanied by (another person or thing)'". That is not true. That is one definition of 'with'. A good dictionary will have a dozen more, including one that covers "lodge/file a complaint with". Usage follows definition, but definition also follows usage.
Note how if you say "I'm married with three kids", you don't label yourself a polygamous pedophile, either. And as I commented on that other question, in German, which is closely related to English, one is actually married with someone and it's "married to" that would be ungrammatical. In Russian, you'd be married on your wife, while she is married behind you. That goes to show that there is no one true universal meaning to any given preposition. Current usage = coincidence + tradition.