I have two ideas on how to do that, both require authoring but the first one will definitely be easier than the second one.
However, could you first clarify what you mean by I want to create a dynmic group with the Object "Microsoft.Windows.InternetInformationServices.10.0.WebSite" for all Computer that are containted in "MyClass"." ?
Do yo mean that "MyClass" is a class hosted by or contained by the Windows Computer class, and that you would like the group to contain all the IIS WebSites that are contained in the same computer?
If yes, that can be achieved fairly easily with a group using contains/contained syntax : https://kevinholman.com/2020/07/09/how-to-create-a-scom-group-of-disks-that-are-related-to-an-application-using-contained-and-contains/
The second option involves some pretty advanced authoring so I would rather avoid going into lengthy explanations if they are not required ;)