If they are saying thanks to you then it is your choice how you want to respond. If it is a formal thank you, then you can choose to thank them too. For example if you had an interview, "I appreciated the interview we had today, I felt very comfortable and look forward to us meeting again."
But this really depends a lot on what exactly happened, what they are thanking you for, and how you feel. There is no one way to do it. Formal English is very similar to informal English, so it won't matter very much which one you use in this type of message.
Formal English can be difficult because it is subtle. Mostly in formal English you would avoid using more than one adverb per couple of sentences. In my example I used the word "very" but only when it was the most important. I didn't say "I - really - appreciated the interview". Because that would be too much.
I hope this was helpful.