It's hard to live in a society and avoid intermarriage. The Torah clearly warns us (34:15-16) that such social relationships can result in religious and marital disaster.
פן תכרת ברית ליושב הארץ וזנו אחרי אלהיהם וזבחו לאלהיהם וקרא לך ואכלת מזבחו
ולקחת מבנתיו לבניך וזנו בנתיו אחרי אלהיהן והזנו את בניך אחרי אלהיהן
A few weeks ago, someone asked me about a company dinner, to be held in a hotel. Kosher food was to be provided for him and his fellow Orthodox employees, but he was uncomfortable attending. He pestered me until I found an issur for him- that the kosher food would not be under lock and key the whole time, and there was not really a mashgiach there, so there was a slight chashash that some food might get mixed up. (Even though we are not makpid on nis'aleim, there are times that it is kedai to be choshesh.)
In light of our passuk and Chazal's expansion of the issur, I regret not being more thorough in my answer. It applies to so many instances - attending a gentile's wedding, even if you do not eat anything, getting a beer at a bar in the airport, attending a company party, or going out to a restaurant with a client that invited you to lunch. The Rashba adds that kedoshim avoid social contact even beyond the letter of the issur.
The sugya is very broad, and I can't do anything here and now more that to cite the essential mm's. The prominent sources are the Gemara in AZ 8 and 30, the Rambam Maachalos Asuros 17, and the Mechaber in 114 and 152. The Aruch HaShulchan YD 114 goes through this sugya at the beginning of the se'if and explains the Rama in 114 who is meikil bizman hazeh. But even the Aruch HaShulchan is somewhat mashma in sk 5 that he prohibits eating at one table at a mesiba.
Another thing to remember is what my son, Rav Mordechai, said about a halacha in the harchakos of nidah. The Mechaber (YD 195:9) says
בקושי התירו לה להתקשט בימי נדתה אלא כדי שלא תתגנה על בעלהwhich is from the Ramban which is from Reb Akiva (Shabbos 64b.) The question is, why does the Mechaber say it? His work to to say psak halacha, not the legislative history of psak halacha. Indeed, he could have quoted the Rambam (end of 11 IB,) who simply says
מותר לאשה להתקשט ממי נדתה כדי שלא תתגנה על בעלהwithout the "bekoshi." Pshat is that the Mechaber wants you to realize that it's 100% muttar, but have the seichel to not go overboatd. Cosmetics and perfume, fine. Channeling Helen of Troy, no. Here, too, even given that the Rama says that we're meikil in many aspects of this halacha, one must bear in mind that there is a serious problem involved and one must be constantly aware and sensitive to the dangers, and modify his behavior accordingly.