Both versions are grammatically correct. I agree with Sheena and Irene that both "with whom" and "whom ... with" are overly formal, though. You'll rarely see either of these structures used except in very formal writing. From a purely grammatical standpoint, though, they are both fine. Separating the preposition from the relative pronoun is fine.
Sheena has already given a few of these, but here's another example, using "which" instead of "whom."
"The pen with which I'm writing is red." (grammatically correct, but very formal)
"The pen which I'm writing with is red." (okay, but the word "which" is unnecessary)
"The pen I'm writing with is red." (correct, and common)