I am not certain if I understood exactly what you want to achieve, so is the situation like this:
You retrieve objects from a database so that some of them have references to objects of the other type. You want to display those references as something human readable, and you do not want or cannot add a suitable toString() method in claseB.
I am assuming that the claseB instance in claseA and its name are not lazily loaded by JPA/Hibernate, or that you are using a database library that handles lazy loading outside of the original transaction gracefully (I believe EclipseLink does, Hibernate does not).
One way to do this with a generated column that has the same name as the original property, and that returns a Label with the name. When you adding a generated column with the same property name as a normal visible column in the table, it “overrides” the original one in your table. This way, you would still keep all the other functionality of BeanItemContainer, even though your example would not really be shorter.
Such formatting etc. should get easier in future versions of Vaadin.
Note also that if you use BeanItemContainer, the bean identifiers, which in BeanItemContainer are the beans (entities) themselves, should have equals() and hashCode() methods based on their (database) identifiers. In Vaadin 6.5, there will be an alternative to BeanItemContainer that allows the item identifiers to be something else than the beans themselves, e.g. directly their database identifiers extracted from the beans.