You can import products and their variants with the import screen. It's written clearly in that documentation:
Finally, you can also insert variants of products. You will have to specify in the product_parent_id column the product_code of the main product which must be inserted before the variants in the file. You will also have to have column names matching the characteristics in the store.
For example, suppose that you have a product with 1 characteristic being the size and two variants:
product_code,product_parent_id,size
main_product,,big
first_variant,main_product,big
second_variant,main_product,small
You will be able to insert one price per variant or product.