How well do you know said friend?
I don't think people realize how many people cannot have cheese. My dh is one of them. He is lactose intolerant. He can have some cheese, (loves pizza, but in limited doses), but too much and it will cause him great pain. You cannot believe the number of times we go somewhere and he requests no cheese, and he gets this strange looks and always has to be asked again. Yes, he said no cheese. There have to be more people out there who cannot have cheese, right?
Also, because of having a child who is a picky eater, I have always just made a variety of food when having guests over. I never just use one ingredient for almost everything I make, especially cheese, as that can bind even the most normal person up. And, honestly, I cannot remember a time when I invited or did the inviting, that there was not a variety of foods to choose from. But, then I am Berks County, PA, Dutch Country(where no matter what, we always have a variety of food. We love to eat). Also, no matter what, even when we are invited somewhere or vice versa, people would bring something also to add to the mix and I would do the same. In fact, I am invited to a picnic next Saturday and I will take something to add to the mix.
Also, I grew up always having to eat what was put before me, even if I did not like it. I could not get up from the table until doing so. This made for many nights where I sat at the table until dark. I never did that to my kids. If I cooked something I know they would not like, they were given a choice of something else. (Usually easy, cereal or a sandwich, not a whole other meal). So, I could never make a meal where I had so limited choices as the OP had when entertaining. You have a variety of people with different tastes, likes, etc. I would always have two choices of desserts, at least.
That is not to say, I think my way is the right way. Just what works for me and I have never had a problem with or a complaint.
What to do in this situation? Nothing could be done at the time. Should he have mentioned it when being invited? Possibly. Should the hostess have asked when inviting? Again. Possibly. I see this working both ways and not one way being preferred over the other.
What I can tell you is in my dh's case, he would have gone away from your house very hungry and we would have stopped at the first place that we could so he could eat. He would never have said anything and might have eaten items in very small amounts, but I know him and he would be starving. But, he would have been polite and sat thru the meal and whatever was after and we would have left as soon as we could, because I know he would have been very hungry.