The gemara says that Ulah would kiss his sister, and then says that he contradicted his own opinion that any expression of intimacy is forbidden for the arayos based on the concept of לך לך אמרין נזירא, meaning that we build a fence to prevent violations. Tosafos explains that for Ulah it wasn't an inherent contradiction. U'lah held that for arayos such as a sister for which there is no natural attraction, the nature of the issur is only preventative, therefore since he knew about himself that this behavior wouldn't lead to improper thoughts it was permitted.
Rav Moshe Feinstein (Dibros, Hearah 78) asks, how does the gemara know that there is any contradiction, perhaps it is permitted to kiss those arayos for which one doesn't have any desire for, and the statement of Ulah which forbids is speaking about the other arayos? Rav Moshe explains that for other arayos for which there is a desire, it is an inherent prohibition to kiss and hug (either d'oraysa according to rambam or d'rabonon according to ramban), and wouldn't be referred to as a issur due to לך לך אמרין נזירא, which implies it is a lower level, preventative type issur. Since Ulah only forbade it based on לך לך אמרין נזירא, it must be speaking about a sister and other arayos such as a mothers sister for which one has no desire.
The Rambam (Issurei Biah 21:6) writes:
המחבק אחת מן העריות שאין לבו של אדם נוקפו עליהן או שנשק לאחת מהן כגון אחותו הגדולה ואחות אמו וכיוצ"ב אע"פ שאין שם תאוה ולא הנאה כלל, הרי זה מגונה ביותר ודבר אסור הוא ומעשה טפשים, שאין קרבין לערוה כלל בין גדולה בין קטנה חוץ מהאם לבנה והאב לבתו
The Magid Mishna explains that the source of this Rambam is our gemara, where for U'lah it was permitted but for others is a violation of לך לך אמרין נזירא. Rav Moshe explains that the language of the Rambam implies that is isn't really an issur therefore he uses the language of issur only after using the language of meguneh, to indicate it is a לך לך אמרין נזירא level issur. A real issur d'rabonon could never be called a ma'aseh tipshus and meguneh.
The Rambam makes an exception for a father/daughter and mother/son. The Beis Shmuel (21:14) extends this heter to בת בתו as well (which is against the Ran who says that a father can only kiss his daughter but not his granddaughter). In the next halacha the Rambam says that although when they are young a father may kiss his daughter and sleep in the same bed as her, after she matures (same with mother and son), it is forbidden. The Rambam also writes that if they are married, it also becomes an issur. However, it is not clear from the Rambam whether after they mature physically it is forbidden only to sleep in the same bed with, or also forbidden to hug and kiss. The Beis Shmuel (15) cites the Prisha that a father may hug and kiss a daughter (and mother a son) even after they reach physical maturity. Rav Moshe (Dibros) assumes that the heter to hug and kiss a granddaughter would also apply after she reaches physical maturity. However, in the Igros Moshe (E.H. 1:60) Rav Moshe writes that there is a rationale to distinguish between a son's daughter and a daughter's daughter. Perhaps the Beis Shmuel only permits בת בתו because it won't lead to any hirhurim since one has not desire for בתו, but בת בנו may remind one of his daughter in law for which there is a desire and therefore forbidden. Rav Moshe holds that this is an area which the poskim weren't machriah in, therefore if one wants to be lenient to hug and kiss בת בנו, there is grounds to be lenient, but there is also reason to be machmir.
Rav Moshe seems to contradict himself between the Igros and Dibros as to whether one may hug and kiss a daugher and grand daughter (בת בתו) after she is married. In the Dibros Moshe he writes that marriage makes her like a gedolah, but not worse than a gedolah, so it is still permitted to hug and kiss her, and only forbidden to put her in your lap which is like sleeping in the same bed. However, in the Igros Moshe, he seems to hold that once she is married, it is forbidden to hug and kiss a daughter and grand daughter. Rav Moshe explains that once they are married and intimate with their husband, there is a greater concern of any physical contact leading to hirhurim.
In short - Hugging and kissing a daughter is permitted. A daughter's daughter is also permitted according to Beis Shmuel (which we pasken like, against the Ran). Rav Moshe has some reservations about a son's daughter and says that a ba'al nefesh should be machmir. This even applies when they are adults, but Rav Moshe seems to contradict himself regarding a married daughter and grand daughter whether hugging and kissing is permitted (it seems more logical to permit, since the chiddush is that a married girl is like a gedolah even when she is a ketana, but we don't see a source for her being worse than a gedolah).