I got an answer for this in the Aspire Github repo. If no connecion string is necessary, simpler if the IResourceWithServiceDiscovery is implemented instead of the IResourceWithConnectionString. (LabseResource class in my case) IResourceWithServiceDiscovery also has an implementation of the WithReference extension method.
Unfortunatelly no mention about IResourceWithServiceDiscovery in the hosting integration example in the docs, so it can be a bit misleading.