Yes, "with whom" is grammatically correct as we use it with the preposition with when "Whom" is an objective pronoun. This means it acts as the object of a verb.It's used when the pronoun is the object of a verb or a preposition.
ex:
with whom do you live?