Variable scope, libraries

However I fear that the scope of a is limited to the loop function, and therefore the instance of A is deleted and my pointer in listofa points to ?*$!@¤# in the next execution of loop.

That's a reasonable fear, because that is exactly what happens.

I considered doing something like this ... and create the instance of A in b.add. However I prefer to keep a list of A* to save memory.

Creating an instance takes space. Storing that instance, or a pointer to the instance that is stored elsewhere, will take the same amount of space.

And I am unsure I can do something like

Perhaps you've noticed that the new and delete operators are not implemented on the Arduino. They can be added, but creating an instance takes space, whether you have an object to deal with, or a pointer to the object to deal with.