Unlike on Shabbat, on Yom Tob it is permissible to cook. However, the Rambam (Rabbi Moshe Maimonides, Spain-Egypt, 1132-1204) writes in Hilchot Yom Tob (chapter 1; listen to audio recording for precise citation) that one is allowed to cook on Yom Tob only for himself or for other Jews. It is forbidden to cook food on Yom Tob to serve it to a non-Jew. The Rambam cites the verse, "only that which will be eaten by any soul – only that shall be done for you" (Shemot 12:16), which indicates that cooking is permissible on Yom Tob if it is done "for you" – for Jews, and not for gentiles. This is, indeed, the accepted Halacha.
However, if a person cooked food for himself or his family on Yom Tob, and some food was left over, it may be served to a gentile, such as to one’s non-Jewish housekeeper. Since the food was cooked with the intention of serving it to Jews, the leftovers may be given to a non-Jew. The prohibition relates only to cooking food specifically for a gentile. Thus, for example, one may not fry an egg for his housekeeper or boil water for her on Yom Tob. If, however, one cooked a large pot of rice for the Yom Tob meal, it would certainly be permissible to allow the housekeeper to eat the leftover rice.
The Ben Ish Hai (Rav Yosef Haim of Baghdad, 1833-1909) addresses the case of a gentile who visits a Jew on Yom Tob, and the Jew wants to offer him a cup of coffee as a display of courtesy. As mentioned, it is forbidden to cook specifically for a gentile, and this would include brewing coffee. However, the Ben Ish Hai writes that the Jew may prepare coffee for himself and his family so that he can serve the leftovers to the gentile. According to the Ben Ish Hai, one can circumvent the prohibition by cooking coffee for oneself and then giving some to the gentile.
Hacham Ovadia Yosef, however, disagrees. He contends that it is forbidden to cook for oneself for the specific purpose of giving the leftovers to a non-Jew. One may cook on Yom Tob only because the food is needed for himself or another Jew. As the Rambam writes, if it then happens that non-Jews arrive, he may share with them the food he had prepared for himself and his family. However, it is forbidden to go out off one’s way to make food for himself or his family so that the gentile will have the leftovers.
Summary: It is permissible to cook for oneself or for other Jews on Yom Tob, but it is forbidden to cook for a gentile on Yom Tob. If food was prepared on Yom Tob for Jews, it may be shared with a gentile. However, one may not prepare food for himself or for his family with the specific intention that the leftovers will be given to a gentile.