You can find the documentation for integrating C++ and QML here: http://developer.blackberry.com/cascades/documentation/dev/integrating_cpp_qml/
As a cliff's notes:
In your HelloBB constructor you can expose the class to the QML like so:
qml->setContextProperty("HelloBB", this);
And then create a method in the C++ that you will be able to call from the QML. Remember, the method has to be marked as Q_INVOKABLE to be called from the QML.
Consider this:
In HelloBB.hpp:
public:
Q_INVOKABLE void test();
In HelloBB.cpp:
void HelloBB::test() {
qDebug() << "TEST";
}
In main.qml:
onClicked: {
HelloBB.test ()
}