In your class constructor you have to bind a function to your component, something along the lines of:
CapsuleComponent->OnComponentBeginOverlap.AddDynamic(this, &AYourClass::YourFunction);
Then either set the behaviour of the component in an inherited blueprint or before you bind it in c++. Look up the functions available and how collision channels work in ue4 to know what is going to actually fire the event. Id suggest creating another component and setting that thing’s behaviour, then attaching it to the root component all in c++. Im sure if you look around a bit you’ll find a lot of examples and tutorials. I think the C++ tutorial by epic covers this topic and shows the code.