For a quick start, we can use the existing ROS plugin package, pluginlib_calculator.
If we want to create this package from scratch, we can use the following command:
$ catkin_create_pkg pluginlib_calculator pluginlib roscpp std_msgs
The main dependency of this package is pluginlib. We can discuss the main source files in this package to build plugins. However, you can get the plugin code from the code provided with this book or download it at this link:
$ git clone https://github.com/jocacace/plugin_calculator